package structures;

public class TransactionParser {

	public Operation parser(String arg, Object object){
		//fazer o parser pra quando for um commit
		String type = arg.substring(0, 1);
		String transactionId = arg.substring(1, 2);
		Lock lockType = null;
		if (type.equals("w") || type.equals("W")){
			lockType = Lock.WL;
		}else if (type.equals("r") || type.equals("R"))
			lockType = Lock.RL;
		return new Operation(object,lockType,Integer.parseInt(transactionId));
	}
}
